The syntax for defining and using unions is identical to that for structs.
union input_value
{
int i;
float f;
};
Unlike a struct, however, declaring a variable of this type allocates space for only the LARGEST member in the union. When a value is assigned to one of the members, any value formerly associated with another member is lost; that is, only one member contains a value at a time. This property is useful when the programmer would like to define a variable which can take on values of different types at different points in his/her program.